<h2>Why is this an issue?</h2>
<p>The <a
href="https://learn.microsoft.com/dotnet/api/system.diagnostics.codeanalysis.excludefromcodecoverageattribute">ExcludeFromCodeCoverageAttribute</a> is
used to exclude portions of code from <a href="https://learn.microsoft.com/dotnet/core/testing/unit-testing-code-coverage">code coverage
reporting</a>. It is a bad practice to retain code that is not covered by unit tests. In .Net 5, the <code>Justification</code> property was added to
the <code>ExcludeFromCodeCoverageAttribute</code> as an opportunity to document the rationale for the exclusion. This rule raises an issue when no
such justification is given.</p>
<h3>Noncompliant code example</h3>
<pre>
Public Structure Coordinates

    Public ReadOnly Property X As Integer
    Public ReadOnly Property Y As Integer

    &lt;ExcludeFromCodeCoverage&gt; ' Noncompliant
    Public Overrides Function Equals(obj As Object) As Boolean
        If Not (TypeOf obj Is Coordinates) Then
            Return False
        End If

        Dim coordinates = DirectCast(obj, Coordinates)
        Return X = coordinates.X AndAlso
               Y = coordinates.Y
    End Function

    &lt;ExcludeFromCodeCoverage&gt; ' Noncompliant
    Public Overrides Function GetHashCode() As Integer
        Dim hashCode As Long = 1861411795
        hashCode = (hashCode * -1521134295 + X.GetHashCode()).GetHashCode()
        hashCode = (hashCode * -1521134295 + Y.GetHashCode()).GetHashCode()
        Return hashCode
    End Function
End Structure
</pre>
<h3>Compliant solution</h3>
<pre>
Public Structure Coordinates

    Public ReadOnly Property X As Integer
    Public ReadOnly Property Y As Integer

    &lt;ExcludeFromCodeCoverage(Justification:="Code generated by Visual Studio refactoring")&gt; ' Compliant
    Public Overrides Function Equals(obj As Object) As Boolean
        If Not (TypeOf obj Is Coordinates) Then
            Return False
        End If

        Dim coordinates = DirectCast(obj, Coordinates)
        Return X = coordinates.X AndAlso
               Y = coordinates.Y
    End Function

    &lt;ExcludeFromCodeCoverage(Justification:="Code generated by Visual Studio refactoring")&gt; ' Compliant
    Public Overrides Function GetHashCode() As Integer
        Dim hashCode As Long = 1861411795
        hashCode = (hashCode * -1521134295 + X.GetHashCode()).GetHashCode()
        hashCode = (hashCode * -1521134295 + Y.GetHashCode()).GetHashCode()
        Return hashCode
    End Function
End Structure
</pre>
<h2>Resources</h2>
<ul>
  <li> <a href="https://learn.microsoft.com/dotnet/api/system.diagnostics.codeanalysis.excludefromcodecoverageattribute">API browser</a> -
  ExcludeFromCodeCoverageAttribute </li>
  <li> <a href="https://learn.microsoft.com/dotnet/core/testing/unit-testing-code-coverage">DevOps and testing</a> - Code coverage reporting </li>
</ul>

